package cc.aiee.demo.springboot.controller.moneris.bean;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

import cc.aiee.core.abstracts.AbstractQuickModel;
import cc.aiee.core.bean.ValidGroups;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@Schema(description = "信用卡支付接口")
@EqualsAndHashCode(callSuper = false)
public class MonerisPurchaseQuery extends AbstractQuickModel{

	
	@Schema(description = "金额(分)", example = "1", required = true)
	@NotNull(message = "金额必填")
	@Min(value = 1,message = "金额必须大于等于1",groups =ValidGroups.Add.class )
	private Integer amount;
	
	@NotNull(message = "卡号不能为空")
	@Schema(description = "卡号", required = true)
	private String cardNo;

	@NotNull(message = "过期月份不能为空")
	@Schema(description = "过期月份", example = "02", required = true)
	private String cardExpiryMonth;

	@NotNull(message = "过期年份不能为空")
	@Schema(description = "过期年份", example = "22", required = true)
	private String cardExpiryYear;

	@Override
	public <T> T model(T cls) {
		BeanUtil.copyProperties(this, cls, true);
		return cls;
	}
}
